package com.zzyl.controller.manager.visit;

import com.zzyl.base.ResponseResult;
import com.zzyl.service.ElderService;
import com.zzyl.vo.ElderVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客户老人关联 Controller
 */
@RestController
@RequestMapping("/elder")
@Api(tags = "老人")
@RequiredArgsConstructor
public class ElderController {
	
	private final ElderService elderService;
	
	/**
	 * 列表
	 */
	@GetMapping("/selectList")
	@ApiOperation(value = "列表")
	public ResponseResult selectList() {
		List<ElderVo> elderVos = elderService.selectList();
		return ResponseResult.success(elderVos);
	}
	
	
	@GetMapping("/selectByIdCard")
	@ApiOperation(value = "身份证号", notes = "身份证号")
	public ResponseResult selectByIdCard(@RequestParam String idCard) {
		return ResponseResult.success(elderService.selectByIdCard(idCard));
	}
}


